package com.home.fitzx.entity;

import java.util.Date;

import javax.xml.bind.annotation.XmlRootElement;

import org.springframework.format.annotation.DateTimeFormat;

import com.home.fitzx.utils.DateUtil;

@XmlRootElement
public class User {

    private Long id;
    private String name;
    private String password;
    private Integer age;
    private Boolean gender;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    private String address;
    private String email;
    private String description;
    private Date createdAt;
    private Date updatedAt;
    
    public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getAge() {
        return age;
    }
    public void setAge(Integer age) {
        this.age = age;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public Date getCreatedAt() {
        return createdAt;
    }
    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public Boolean getGender() {
		return gender;
	}
	public void setGender(Boolean gender) {
		this.gender = gender;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Date getUpdatedAt() {
		return updatedAt;
	}
	public void setUpdatedAt(Date updatedAt) {
		this.updatedAt = updatedAt;
	}
	@Override
	public String toString() {
		return "User{id=" + id +
				", name="+name +
				", password=" + password +
				", age=" + age +
				", gender=" + gender +
				", birthday=" + (birthday != null ? DateUtil.formatDateTime(birthday) : null) +
				", address=" + address +
				", email=" + email +
				", description=" + description +
				", createdAt=" + (createdAt != null ? DateUtil.formatDateTime(createdAt) : null) +
				", updatedAt=" + (updatedAt != null ? DateUtil.formatDateTime(updatedAt) : null) +
				"}";
		
	}
}
